<template>
  <div class="page">
    <h3>订单详情页</h3>
    <p>需要登录才能访问</p>
    <van-button type="info" @click="handleLogout">退出登录</van-button>
  </div>
</template>

<script>
import { mapMutations } from 'vuex'
export default {
  created() {
    setTimeout(() => {
      this.$bus.$emit('ready')
    }, 2000)
  },
  methods: {
    ...mapMutations('login', ['UPDATE_LOGIN']),
    handleLogout() {
      this.UPDATE_LOGIN(false)
      this.$router.replace('/login')
    }
  }
}
</script>
